package com.chdwmp.product.controller;

import com.chdwmp.product.bean.CommonResponse;
import com.chdwmp.product.bean.params.AppUserSystemSearch;
import com.chdwmp.product.service.BackendService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther: LLL
 * @Date: 2021/3/13 21:10
 * @Description: 后台管理controller
 */
@Api(description = "后台管理模块", tags = {"后台管理接口控制层"})
@RequestMapping("/backend")
@RestController
public class BackendController {

    @Autowired
    BackendService backendService;

    /**
     * 后台获取设备列表
     * @return
     * @throws Exception
     */
    @PostMapping("/getAppSystemList")
    @ApiOperation(value = "后台获取设备列表", notes = "后台获取设备列表", httpMethod = "POST", response = CommonResponse.class)
    public CommonResponse getBackendAppUserSystemInfo(@RequestBody AppUserSystemSearch appUserSystemSearch) throws Exception {
        return new CommonResponse(backendService.getBackendAppUserSystemInfo(appUserSystemSearch));
    }


    /**
     * 设置黑名单
     * @param id
     * @return
     * @throws Exception
     */
    @GetMapping("/setBlackList/{id}")
    @ApiOperation(value = "设置黑名单", httpMethod = "GET", response = CommonResponse.class)
    public CommonResponse setBlackList(@PathVariable String id) throws Exception {
        backendService.setBlackList(id);
        return new CommonResponse();
    }






}
